<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\SpeakingContentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->registerCssFile('@web/css/backstage.css',['depends'=>['app\assets\AppAsset']]);
$this->title = '口语题目';
$this->params['breadcrumbs'][] = $this->title;
$this->registerJsFile('@web/js/setHeight.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/js/searchadmin.js',['depends'=>['app\assets\AppAsset']]);
?>
<div class="box">
<div class="speaking-content-index">
    <div class="main"><!--右侧内容-->
        <div class="cont">
            <div class="title">题目概况</div>
            <div class="details">
                <div class="details_operation clearfix">
                    <div class="bui_select">
<!--                        <input type="button" value="添&nbsp;&nbsp;加" class="add">-->
                        <?= Html::a('添加', ['create'], ['class' => 'btn add']) ?>
                    </div>
                    <div class="fr">
                        <div class="text">
                            <span>日期：</span>
                            <div class="bui_select">
                                <select name="" id="" class="select">
                                    <option value="1"><?= date("Y-m-d "); ?></option>
                                </select>
                            </div>
                        </div>
                        <div class="text">
                            <span></span>
                            <div class="bui_select">
                                <select name="" id="" class="select">
                                    <option value="1">Life without a friend is death.</option>
                                </select>
                            </div>
                        </div>
                        <div class="text">
                            <span></span>
<!--                            <input type="text" value="" class="search">-->
                        </div>
                    </div>
                </div>
                <table class="table" cellspacing="0" cellpadding="0">
                    <thead>
                    </thead>
                    <tbody>
                    <tr>
                        <td><h3><?=Html::encode($this->title)?></h3></td>
                    </tr>
                    <tr>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            [
                'class' => 'yii\grid\DataColumn', //由于是默认类型，可以省略
                'attribute' => "题目二级分类",
                'value' => function ($data) {
                    $data1 = \app\models\Class2::findOne($data->class2_id)->name;
                    return $data1." ".$data->hear_number; // 如果是数组数据则为 $data['name'] ，例如，使用 SqlDataProvider 的情形。
                },
            ],
            'info:ntext:题目简介',
            'content:ntext:内容',
            // 'class1_id',
            // 'class2_id',
            // 'num',
            // 'diff',
            // 'direction',
            // 'topic_content:ntext',
            // 'listening_script:ntext',
            // 'listening_content:ntext',
            // 'reading_tips:ntext',
            // 'reading_content:ntext',
            // 'reading_title:ntext',
            // 'type',
            // 'img_url:url',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</div>
